package api.controller;

import api.feign.CouponService;
import com.lyx.common.param.CouponAdd;
import com.lyx.common.param.CouponAudit;
import com.lyx.common.param.UserCouponAdd;
import com.lyx.common.vo.R;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * --- Be Humble and Hungry ---
 *
 * @author McMeloxD
 * @date 2024/8/14
 * @desc 优惠券接口
 */
@RestController
@RequestMapping("/api/coupon/")
@Tag(name = "优惠券接口")
public class CouponApi {
    @Resource
    private CouponService service;

    @PostMapping("add")
    public R add(@RequestBody UserCouponAdd add){
        return service.add(add);
    }
    @GetMapping("my")
    public R my(Integer uid){
        return service.my(uid);
    }
    @PostMapping("save")
    public R save(@RequestBody CouponAdd add){
        return service.save(add);
    }
    @PostMapping("audit")
    public R audit(@RequestBody CouponAudit audit){
        return service.audit(audit);
    }
    @GetMapping("all")
    public R all(String status){
        return service.all(status);
    }
    @GetMapping("logs")
    public R logs(Integer uid){
        return service.logs(uid);
    }
}
